<include file="public/header" />
<body>
<style>
    .layui-form-label{
        width: 500px;!important;
    }
</style>
<div class="layui-fluid">
    <div class="layui-row">
        <form class="layui-form">
            <div class="layui-form-item">
                <label for="username" class="layui-form-label">
                    <span class="x-red">*</span>支付宝账户或银行卡卡号
                </label>
                <div class="layui-input-inline">
                    <input type="text"  name="card_no" value="" required="" lay-verify="required"
                           autocomplete="off" class="layui-input">
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">姓名<span style="color: red;">(必填)</span></label>
                    <div class="layui-input-block">
                        <input type="text" name="name" style="width: 200px"  autocomplete="off" placeholder="" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">提现类型：<span style="color: red;">(必填)</span></label>
                    <div class="layui-input-block">
                        <input type="radio" name="withdraw_type" value="1" title="银行卡" checked  >
                        <input type="radio" name="withdraw_type" value="0" title="支付宝" >
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">备注<span style="color: red;">(必填)</span></label>
                    <div class="layui-input-block">
                        <input type="text" name="remark" style="width: 200px"  lay-verify="required"  autocomplete="off" placeholder="" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">打款金额（示例：110.23）<span style="color: red;">(必填)</span></label>
                    <div class="layui-input-block">
                        <input type="number" name="amount"  lay-verify="required"  style="width: 150px !important;" autocomplete="off" placeholder="" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">提现到银行卡时，账户类型：<span style="color: red;">(必填)</span></label>
                    <div class="layui-input-block">
                        <input type="radio"  name="account_type" lay-filter="account_type" value="00" title="00对私" checked  >
                        <input type="radio" name="account_type" lay-filter="account_type" value="01" title="对公" >
                    </div>

                </div>

                <div class="layui-form-item hide-content" style="display: none">
                    <label class="layui-form-label">提现到银行卡时，开户行名称，对公必传，填写银行名称，不需要具体的支行<span style="color: red;"></span></label>
                    <div class="layui-input-block">
                        <input type="text" name="bank_name" style="width: 500px"   autocomplete="off" placeholder="" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item hide-content" style="display: none">
                    <label class="layui-form-label">提现到银行卡时，开户行联行号，对公必传<span style="color: red;"></span></label>
                    <div class="layui-input-block">
                        <input type="text" name="brach_bank_code" style="width: 500px"   autocomplete="off" placeholder="" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">描述<span style="color: red;"></span></label>
                    <div class="layui-input-block">
                        <input type="text" name="body" style="width: 500px"   autocomplete="off" placeholder="" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">通道</label>
                    <div class="layui-input-block">
                        <input type="radio" checked name="channel_code" value="Safe" title="聚合支付"  >
                        <input type="radio" checked name="channel_code"   value="Canlang" title="沧澜支付"  >
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">回调地址</label>
                    <div class="layui-input-block">
                        <input type="text" name="notify_url" style="width: 500px"   autocomplete="off" placeholder="" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item" >
                    <label class="layui-form-label"></label>
                    <div class="layui-input-block">
                        <input type="hidden" name="id" value="{$info.id}">
                        <button type="button"  class="layui-btn" lay-submit=""  lay-filter="addEdit">确定打款</button>
                    </div>
                </div>
        </form>
    </div>
</div>
<script>


    layui.use(['form', 'layedit', 'laydate','jquery','upload'], function(){
        var form = layui.form
            ,layer = layui.layer
            , $ = layui.jquery
            , upload = layui.upload
            ,laydate = layui.laydate
            ,inputTags = layui.inputTags
        var layedit = layui.layedit;
        //拖拽上传
        form.on('radio(account_type)', function(data){
			    console.log(data.value); //被点击的radio的value值
            if(data.value == '01'){
                $(".hide-content").show();

            }else{
                $(".hide-content").hide();

            }
        });

        form.on('submit(addEdit)', function(data){
            $.post($('form').attr('action'),data.field,function(data){
                if(data.code == 200){
                    layer.msg(data.msg);
                    setTimeout(function () {
                        xadmin.close();
                        xadmin.father_reload();
                    },3000)

                }else {
                    layer.msg(data.msg);
                }
            });
            return false;
        });
    });

</script>
</body>

</html>
